package com.atqinke.designpattern.creationtype.factory;

import com.atqinke.designpattern.creationtype.factory.pojo.BubbleTea;
import com.atqinke.designpattern.creationtype.factory.pojo.MilkTea;
import com.atqinke.designpattern.creationtype.factory.pojo.Tea;

/**
 * @BelongsProject: BasicConnection
 * @BelongsPackage: com.atqinke.DesignPattern.creation.factory
 * @Author: NieHk
 * @CreateTime: 2022-08-25  22:38
 * @Description: 奶茶工厂
 * @Version: 1.0
 */
public class TeaFactory implements FactoryTea{
    @Override
    public Tea production(String tea) {
        if ("milktea".equals(tea)){
            return new MilkTea();
        }else if ("bubbletea".equals(tea)){
            return new BubbleTea();
        }else {
            return null;
        }
    }
}
